/* ============================================================================
Copyright (c) 2006-2014, Broadcom Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
============================================================================ */

/**
 * \file
 *
 * This file is not part of the public interface.
 * Objects declared here should not be used externally.
 */

#if !defined(VC_IMAGE_TFORMAT_H)
#define VC_IMAGE_TFORMAT_H

#if _VC_VERSION < 3
#error "T-formats are for VideoCore 3 only."
#endif

#include "vc_image.h"

/* Conversions */

void vc_image_tf_rgba32_to_rgba32_part(VC_IMAGE_T *dest, int x_off, int y_off, int width, int height, VC_IMAGE_T const *src, int src_x_off, int src_y_off);
void vc_image_tf_rgba32_to_rgba32(VC_IMAGE_T *dest, VC_IMAGE_T const *src, VC_IMAGE_TRANSFORM_T transform);
void vc_image_tf_rgbx32_to_rgba32(VC_IMAGE_T *dest, VC_IMAGE_T const *src);
void vc_image_tf_rgb565_to_rgb565_part(VC_IMAGE_T *dest, int x_off, int y_off, int width, int height, VC_IMAGE_T const *src, int src_x_off, int src_y_off);
void vc_image_tf_rgb565_to_rgb565(VC_IMAGE_T *dest, VC_IMAGE_T const *src);

void vc_image_tf_rgba32_to_rgb888(VC_IMAGE_T *dest, VC_IMAGE_T const *src);

void vc_image_rgba32_to_tf_rgba32_part(VC_IMAGE_T *dest, int x_off, int y_off, int width, int height, VC_IMAGE_T const *src, int src_x_off, int src_y_off);
void vc_image_rgba32_to_tf_rgba32(VC_IMAGE_T *dest, int y_off, VC_IMAGE_T const *src, VC_IMAGE_TRANSFORM_T transform, int swap_flags);
void vc_image_rgb565_to_tf_rgb565_part(VC_IMAGE_T *dest, int x_off, int y_off, int width, int height, VC_IMAGE_T const *src, int src_x_off, int src_y_off);
void vc_image_rgb565_to_tf_rgb565(VC_IMAGE_T *dest, VC_IMAGE_T const *src, VC_IMAGE_TRANSFORM_T transform);
void vc_image_rgb565_to_tf_rgba32(VC_IMAGE_T *dest, VC_IMAGE_T const *src, VC_IMAGE_TRANSFORM_T transform);

void vc_image_tf_rgba32_to_rgb565(VC_IMAGE_T *dest, VC_IMAGE_T const *src);

void vc_image_rgb888_to_tf_rgbx32(VC_IMAGE_T *dest, VC_IMAGE_T const *src, VC_IMAGE_TRANSFORM_T transform);
void vc_image_rgb888_to_tf_etc1(VC_IMAGE_T *dest, VC_IMAGE_T const *src, VC_IMAGE_TRANSFORM_T transform);
#define vc_image_yuv420_to_tf_etc1 vc_image_rgb888_to_tf_etc1
#define vc_image_yuv422_to_tf_etc1 vc_image_rgb888_to_tf_etc1
#define vc_image_yuv422p_to_tf_etc1 vc_image_rgb888_to_tf_etc1
#define vc_image_yuv_uv_to_tf_etc1 vc_image_rgb888_to_tf_etc1
#define vc_image_rgba16_to_tf_etc1 vc_image_rgb888_to_tf_etc1
#define vc_image_rgb565_to_tf_etc1 vc_image_rgb888_to_tf_etc1
#define vc_image_rgba32_to_tf_etc1 vc_image_rgb888_to_tf_etc1
#define vc_image_opengl_to_tf_etc1 vc_image_rgb888_to_tf_etc1

void vc_image_rgb888_to_ogl_etc1(VC_IMAGE_T *dest, VC_IMAGE_T const *src, VC_IMAGE_TRANSFORM_T transform);
#define vc_image_yuv420_to_ogl_etc1 vc_image_rgb888_to_ogl_etc1
#define vc_image_yuv422_to_ogl_etc1 vc_image_rgb888_to_ogl_etc1
#define vc_image_yuv422p_to_ogl_etc1 vc_image_rgb888_to_ogl_etc1
#define vc_image_yuv_uv_to_ogl_etc1 vc_image_rgb888_to_ogl_etc1
#define vc_image_rgba16_to_ogl_etc1 vc_image_rgb888_to_ogl_etc1
#define vc_image_rgb565_to_ogl_etc1 vc_image_rgb888_to_ogl_etc1
#define vc_image_rgba32_to_ogl_etc1 vc_image_rgb888_to_ogl_etc1
#define vc_image_opengl_to_ogl_etc1 vc_image_rgb888_to_ogl_etc1

void vc_image_yuv420_to_tf_rgba32_part(VC_IMAGE_T *dest, int x_off, int y_off, int width, int height, VC_IMAGE_T const *src, int src_x_off, int src_y_off);
void vc_image_yuv420_to_tf_rgba32(VC_IMAGE_T *dest, VC_IMAGE_T const *src);
void vc_image_yuv422_to_tf_rgba32(VC_IMAGE_T *dest, VC_IMAGE_T const *src);

void vc_image_yuv420_to_tf_rgb565(VC_IMAGE_T *dest, VC_IMAGE_T const *src);
void vc_image_yuv422_to_tf_rgb565(VC_IMAGE_T *dest, VC_IMAGE_T const *src);

void vc_image_yuv_uv_to_tf_rgba32(VC_IMAGE_T *dest, VC_IMAGE_T const *src);
void vc_image_yuv_uv_to_tf_rgb565(VC_IMAGE_T *dest, VC_IMAGE_T const *src);

void vc_image_transpose_tf_rgba32(VC_IMAGE_T *dest, VC_IMAGE_T const *src);
void vc_image_transpose_tf_rgb565(VC_IMAGE_T *dst, VC_IMAGE_T const *src);

#endif /* !defined(VC_IMAGE_TFORMAT_H) */

